package local.blueheart.java8;

import java.util.function.Function;

public class FunctionTest {
    public static void main(String[] args) {
        FunctionTest functionTest = new FunctionTest();
        System.out.println(functionTest.compute(1,value -> 2*value));
        System.out.println(functionTest.covert(2,value -> String.valueOf(value + " hello")));
    }

    public int compute(int a, Function<Integer,Integer> function){
        return function.apply(a);
    }

    public String covert(int a,Function<Integer,String> function){
        return function.apply(a);
    }
}
